/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
var showPromotion = function(elem, show){
	var elem = $('.promoContent');
        var elemm= $('.promoBg');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
                        elemm.show(200);
		}
	}
	else{
			elem.hide(200);
                        elemm.hide(200);
	}
}

var showPromotionSale = function(elem, show){
    var elem = $('.sale');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showPromotionPromotions = function(elem, show){
    var elem = $('.promotions');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showPromotionNews = function(elem, show){
    var elem = $('.news');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showPromotionBasket = function(elem, show){
    var elem = $('.basket');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showPromotionRules = function(elem, show){
    var elem = $('.rules');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showPromotionContact = function(elem, show){
    var elem = $('.contact');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
			elem.hide(200);
	}
}

var showNewsletter = function(elem, show){
	var elem = $('.newsletterSignIn');
	if(!elem.is(':visible')){
		if(show){
			elem.show(200);
		}
	}
	else{
		
			elem.hide(200);
		
	}
}

$(document).ready(function(){
  $('.newsletterBox').click(function(){
	showNewsletter(this, true);
  });
  $('.newsletterSignIn').mouseout(function(){
	showNewsletter(this, false);
  });
  $('.btn1').click(function(){
      showPromotion(this, true);
      showPromotionNews(this, true);
  });
  $('.btn2').click(function(){
      showPromotion(this, true);
      showPromotionPromotions(this, true);
  });
    $('.btn3').click(function(){
      showPromotion(this, true);
      showPromotionSale(this, true);
  });
      $('.btn4').click(function(){
      showPromotion(this, true);
      showPromotionBasket(this, true);
  });
      $('.btn5').click(function(){
      showPromotion(this, true);
      showPromotionRules(this, true);
  });
      $('.btn6').click(function(){
      showPromotion(this, true);
      showPromotionContact(this, true);
  });
  $('.promoBg').click(function(){
      showPromotion(this, false);
      showPromotionNews(this, false);
      showPromotionPromotions(this, false);
      showPromotionSale(this, false);
      showPromotionBasket(this, false);
      showPromotionRules(this, false);
      showPromotionContact(this, false);
  });
  $('.rightbtn').mouseover(function(){
	$(this).popover('show');
  });
  $('.rightbtn').mouseleave(function(){
	$(this).popover('hide');
  });
  
});
